﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using Ignitron.EEngine;
using Ignitron.EEngine.Maths;

namespace OpenTKLightingTool.Data
{
    /// <summary>
    /// Class responsible for axes system configuration
    /// </summary>
    internal class AxesSystem
    {
        private const float mMax = 2f;

        public bool Show
        { get; set; }

        public bool ShowLights
        { get; set; }

        /// <summary>
        /// Constructor - set default values
        /// </summary>
        public AxesSystem()
        {
            Show = false;
            ShowLights = false;
        }

        /// <summary>
        /// Renders the axes system
        /// </summary>
        public void Render(IEngine engine)
        {
            if (Show)
            {
                engine.EnableLighting(false);

                engine.BeginLines();

                engine.RenderLine(new EVector3(0, 0, 0), new EVector3(mMax, 0, 0), new EVector4(1, 0, 0, 1));
                engine.RenderLine(new EVector3(0, 0, 0), new EVector3(0, mMax, 0), new EVector4(0, 0, 1, 1));
                engine.RenderLine(new EVector3(0, 0, 0), new EVector3(0, 0, mMax), new EVector4(0, 1, 0, 1));

                engine.EndLines();
                engine.EnableLighting(true);
            }
        }
    }
}
